<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>参数</title>
</head>

<body>
    <script type="text/javascript">
        sum(3, 4);
        sum("3", 4);
        sum("Hello", "World")

        function sum(a, b) {
            console.log(a + b);
        }
        //实参和形参的个数不匹配时
        function sum(a, b) {
            console.log(a + b);
        }

        sum(1, 2);
        sum(1, 2, 3);
        sum(1);
    </script>
</body>

</html>